package Server;

import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.net.InetAddress;
import java.util.List;

public class ServerMain {
    public static List<MessageForward> connSocketList = new ArrayList<>();

    public static void main(String[] args) throws Exception {
        InetAddress serverIP = InetAddress.getLocalHost();
        int serverPort = 8080;
        ServerSocket serverSocket = new ServerSocket(serverPort, 10, serverIP);
    
        while(true) {
            Socket connSocket = serverSocket.accept();
            MessageForward messageForward = new MessageForward(connSocket);
            messageForward.run();
            connSocketList.add(messageForward);
        }
        // serverSocket.close();
    }
}
